﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ThemTinTuc.ascx.cs" Inherits="ThemTinTuc" %>
<%@ Register Assembly="FredCK.FCKeditorV2" Namespace="FredCK.FCKeditorV2" TagPrefix="FCKeditorV2" %>
<%@ Register Src="../Common/ImagePath.ascx" TagName="ImagePath" TagPrefix="uc1" %>
<table cellpadding="0" cellspacing="0" width="100%" class="admintable">
    <tr runat="server" visible="false">
        <td class="lable">
            Ngôn ngữ:
        </td>
        <td>
            <asp:DropDownList ID="cmbLanguage" runat="server" Width="112px">
                <asp:ListItem Text="Vietnamese" Selected="True" Value="vi-VN"></asp:ListItem>
                <asp:ListItem Value="en-US">English</asp:ListItem>
            </asp:DropDownList>
        </td>
    </tr>
    <tr runat="server" visible="false">
        <td class="lable">
            Chuyên mục tin:<strong><span style="color: #ff0000">(*)</span></strong>
        </td>
        <td>
            <asp:DropDownList ID="cmbChuyenMuc" runat="server" Width="455px">
            </asp:DropDownList>
            <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
                ControlToValidate="cmbChuyenMuc" ErrorMessage="Chọn chuyên mục tin" 
                SetFocusOnError="True"></asp:RequiredFieldValidator>
        </td>
    </tr>
    <tr>
        <td class="lable">
            Tiều đề: <span style="color: red"><strong>(*)</strong></span>
        </td>
        <td>
            <asp:TextBox ID="txtTitle" runat="server" Width="450px"></asp:TextBox>
            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtTitle"
                ErrorMessage="Nhập tiêu đề" SetFocusOnError="True"></asp:RequiredFieldValidator>
        </td>
    </tr>
    <tr>
        <td class="lable" valign="top">
            <%--Trích dẫn:<span style="color: red"></span>--%>
        </td>
        <td>
            <table cellpadding="0" cellspacing="0" width="100%">
                <tr>
                    <td valign="top" style="width: 140px;">
                        <uc1:ImagePath ID="ImagePath" runat="server" />
                    </td>
                    <td>
                        <span class="headertext">Mô tả ngắn</span>
                        <FCKeditorV2:FCKeditor ID="txtTrichDan" runat="server" BasePath="~/fckeditor/" Height="120px"
                            Width="100%" ToolbarSet="Basic">
                        </FCKeditorV2:FCKeditor>
                    </td>
                </tr>
            </table>
        </td>
    </tr>
    <tr>
        <td class="lable" valign="top">
            Nội dung: <strong><span style="color: #ff0000">(*)</span></strong>
        </td>
        <td>
            <FCKeditorV2:FCKeditor ID="txtContent" runat="server" BasePath="~/fckeditor/" Height="450px"
                Width="100%" Value="">
            </FCKeditorV2:FCKeditor>
            <asp:CustomValidator runat="server" ErrorMessage="Nhập nội dung" ID="CustValDesc"
                ControlToValidate="txtContent" ClientValidationFunction="ValidateFCK" ValidateEmptyText="True"></asp:CustomValidator>
        </td>
    </tr>
    <tr  runat="server" visible="false">
        <td class="lable">
            Vị trí:
        </td>
        <td>
            <asp:TextBox ID="txtOrderId" runat="server" Width="61px">0</asp:TextBox>
            <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="txtOrderId"
                ErrorMessage="Giá trị phải là số" SetFocusOnError="True" ValidationExpression="[0-9]*"></asp:RegularExpressionValidator>
        </td>
    </tr>
    <tr  runat="server" visible="false">
        <td class="lable">
            Vùng hiển thị:
        </td>
        <td>
            <asp:DropDownList ID="cmbStatus" runat="server" Width="145px">
                <asp:ListItem Value="1">Trang tin</asp:ListItem>
                <asp:ListItem Value="2" Selected="True">Tin nổi bật</asp:ListItem>
            </asp:DropDownList>
        </td>
    </tr>
    <tr  runat="server" visible="false">
        <td class="lable" style="height: 20px">
            Hiệu lực:
        </td>
        <td style="height: 20px">
            <asp:CheckBox ID="chkIsActive" Checked="true" runat="server" Style="margin-top: 5px;" />
        </td>
    </tr>
</table>

<script language="javascript" type="text/javascript">
function ValidateFCK(source, args) {

var fckBody = FCKeditorAPI.GetInstance('<%=txtContent.ClientID %>');
args.IsValid = fckBody.GetXHTML(true) != "";
}
</script>

